package com.chanyachting.emall.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

import com.chanyachting.emall.util.RequestUtil;

public class YellowpagekeywordForm extends ActionForm {
	
	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer productcategoryId;
	private java.lang.Integer subcategoryId;
	
	
	@Override
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		
		ActionErrors errors=new ActionErrors();
		
		RequestUtil ru=new RequestUtil(request);
		
		if(this.getProductcategoryId().equals(0)){
			
			ru.setMsg("关键字不能为空！");
			
			errors.add("",new ActionMessage(""));
			
		}
		
		if(this.getSubcategoryId().equals(0)){
			
			ru.setMsg("黄页二级分类不能为空！");
			
			errors.add("",new ActionMessage(""));
			
		}
		
		return errors;
	}
	
	
	public java.lang.Integer getId() {
		return id;
	}
	public void setId(java.lang.Integer id) {
		this.id = id;
	}
	public java.lang.Integer getProductcategoryId() {
		return productcategoryId;
	}
	public void setProductcategoryId(java.lang.Integer productcategoryId) {
		this.productcategoryId = productcategoryId;
	}
	public java.lang.Integer getSubcategoryId() {
		return subcategoryId;
	}
	public void setSubcategoryId(java.lang.Integer subcategoryId) {
		this.subcategoryId = subcategoryId;
	}
	
	


}
